<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html lang="zh-tw">
<head>
<meta charset="UTF-8">
<title>${course.title}</title>
<!-- favicon -->
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
<link rel="Bookmark" href="images/favicon.ico" type="image/x-icon"/>
<!-- reset.css -->
<link rel="stylesheet" href="css/reset.css" media="screen">
<!-- Skeleton grid system -->
<link rel="stylesheet" href="css/skeleton.css" media="screen">
<!-- css -->
<link rel="stylesheet" href="css/style.css" media="screen">
<!-- rwdmenu -->
<link type="text/css" rel="stylesheet" href="css/jquery.mmenu.css" />


<!--scrollable-->
<link rel="stylesheet" type="text/css" href="css/scrollable-horizontal.css">
<!-- Layout and Media queries-->
<link rel="stylesheet" href="css/layout.css" media="screen">


<!-- highlightjs -->
<link rel="stylesheet" href="ckeditor/plugins/codesnippet/lib/highlight/styles/rainbow.css">
<!-- font-awesome.css -->
<link rel="stylesheet" href="css/font-awesome.min.css" media="screen">




<!--[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

<meta property="og:title" content="${course.title}">
<meta name="description" content="${course.gist}">
<link rel="image_src" href="https://s3-ap-northeast-1.amazonaws.com/proactive/${course.imagePath}" />
<!-- Mobile Specific Meta -->
<meta name="viewport"
	content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=0">
</head>
<body>
	<div id="page">
		<div class="header FixedTop">
			<a href="#menu" class="headericon"></a>
			<img src="images/logo.png" alt="proactive Logo">
		</div><!-- header -->
		<div class="content">
			<div class="list-screen clearfix">
				<div class="navfull">
					<div class="container">
						<div class="grid_12">
							<div class="logo"><a href="index">Proactive</a></div>
							<ul class="topnav">
							<c:forEach items="${menuList}" var="menu">
								<li>
									<a href="${menu.url}" class="${menu.classString1}">
										${menu.icon}
										${menu.name}
									</a>
								</li>
							</c:forEach>	
							</ul>
							<ul class="login">
								<li><a href="register">註冊</a></li>
								<li><a href="login">登入</a></li>
							</ul>
						</div>
					</div>
				</div>
				<div class="share clearfix">
					<div class="container">
						<!-- AddToAny share --> 
						<div class="grid_12 a2a_kit a2a_kit_size_32 a2a_default_style">
							<ul class="list-screen-condition">	
								<li class="social">
									<a class="a2a_button_facebook topShare">
										<img src="images/fb.png">
										<img src="images/fb2.png" class="fb2">
										<span>分享</span>
									</a>
								</li>
								<li class="social">
									<a href="javascript:;" class="a2a_button_google_plus topGoogle">
										<img src="images/google.png">
										<img src="images/google2.png" class="google2">
										<span>+1</span>
									</a>
								</li>
								<li class="social">
									<a href="#" class="topLove" data-reveal-id="login">
										<img src="images/love.png">
										<img src="images/love2.png" class="love2">
										<span>喜愛</span>
									</a>
								</li>
								<li class="social">
									<a href="#" class="topCollect" data-reveal-id="login">
										<img src="images/collect.png">
										<img src="images/collect2.png" class="collect2">
										<span>收藏</span>
									</a>
								</li>
								<!-- 
								<li class="social">
									<a href="javascript:;" class="topClassify topfocusClassify">
										<img alt="collect" src="images/classify.png">
										<span>分類</span>
									</a>
								</li> -->
							</ul>
							<script type="text/javascript"> 
				         		var a2a_config = a2a_config || {}; 
				         		a2a_config.locale = "zh-TW"; 
				         		a2a_config.linkurl = location.href; show_title=true; 
					        </script> 
					        <!-- AddToAny END -->
					        <c:if test="${course.downloadUrl != '' || course.fileUrl != ''}">
								<a href="${course.isFile==1?course.downloadUrl:course.fileUrl}" target="_blank" class="download"><button class="downloadButton">下載</button></a>
							</c:if>
							<c:if test="${course.demo != ''}">
								<a href="${course.demo}" target="_blank" class="download"><button class="viewButton">展示</button></a>
							</c:if>
						</div>
					</div>
				</div><!-- list-screen -->
			</div>
			<div class="share2 clearfix">
				<div class="container">
					<div class="grid_12 a2a_kit a2a_kit_size_32 a2a_default_style">
						<ul class="list-screen-condition">
							<li class="social">
								<a class="a2a_button_facebook topShare">
									<img src="images/fb.png">
									<img src="images/fb2.png" class="fb2">
									<span>分享</span>
								</a>
							</li>
							<li class="social">
								<a href="javascript:;" class="a2a_button_google_plus topGoogle">
									<img src="images/google.png">
									<img src="images/google2.png" class="google2">
									<span>+1</span>
								</a>
							</li>
							<li class="social">
								<a href="#" class="topLove" data-reveal-id="login">
									<img src="images/love.png">
									<img src="images/love2.png" class="love2">
									<span>喜愛</span>
								</a>
							</li>
							<li class="social">
								<a href="#" class="topCollect" data-reveal-id="login">
									<img src="images/collect.png">
									<img src="images/collect2.png" class="collect2">
									<span>收藏</span>
								</a>
							</li><!-- 
							<li class="social">
								<a href="javascript:;" class="topClassify">
									<img alt="collect" src="images/classify.png">
									<span>分類</span>
								</a>
							</li> -->
						</ul>
				        <c:if test="${course.downloadUrl != '' || course.fileUrl != ''}">
							<a href="${course.isFile==1?course.downloadUrl:course.fileUrl}" target="_blank" class="download"><button class="downloadButton">下載</button></a>
						</c:if>
						<c:if test="${course.demo != ''}">
						<a href="${course.demo}" class="download" target="_blank"><button class="viewButton">展示</button></a>
						</c:if>

					</div>
				</div>
			</div><!-- list-screen -->
			<div class="courseShow">
				<div class="courseHeader">
					<div class="container">
						<div class="grid_7">			
							<!-- <span class="time">2014/07/02</span> -->
							<h1>${course.title}</h1>
							<span>分類: </span>
							<a href="${course.categoryUrl}" class="sort">
								${course.category1Name} / ${course.category2Name}
							</a>
							<c:if test="${course.isWriter != 1}">
								<span>原作者: </span>
								<a href="${course.writerUrl}">${course.writer}</a>
							</c:if>
							<span>發佈時間: </span>
							<span class="time">${course.createDateString}</span>
							<ul class="tools clearfix">
								<li>
									<img src="images/view.png" class="view">
									<span>${course.viewCount}</span>
								</li>
								<li>
									<img src="images/cmnt.png" class="cmnt"> 
									<span>${course.commentCount}</span>
								</li>
								<li>
									<img src="images/like.png" class="like"> 
									<span>${course.favoriteCount}</span>
								</li>
							</ul>
						</div>
						<div class="grid_5">
							<div class="author_contact">
								<!-- <a href="#"><span>私訊</span></a> -->
								<a href="#" data-reveal-id="login"><span class="focus">+關注</span></a>
							</div>
							<a href="aboutme?id=${member.memberNO}" class="author_img">
								<img src="${member.photoPath}">
							</a>
							<div class="author_info">
								<a href="aboutme?id=${member.memberNO}" class="author_info_name">${member.name}</a>
								<p>${member.job}</p>
								<p class="fans">${member.fansCount}粉絲/${member.followCount}關注</p>	
							</div>

						</div>
					</div><!-- //.container -->
				</div><!-- //.courseInfo -->

				<div class="courseDetail">
					<div class="container">
						<div class="prefix_1 grid_10 suffix_1 detailMinHeight">
							${course.content}
						</div>
					</div><!-- //.container -->
					<div class="fullbackground">
						<div class="container">
							<div class="grid_4">
								<div>
									<p class="practiceP">
										上完課程~記得上傳你練習的成果<br/>也可以探索>>>>
										<c:if test="${fn:length(design)>0}">
											<a href="practice?id=${course.id}">&nbsp;所有創意練習!</a>
										</c:if>
									</p>
									<a href="#" class="practiceBtn" data-reveal-id="login"><span>我要上傳練習</span></a>
								</div>
							</div>		
							<div class="grid_8">	
							<c:if test="${fn:length(design)>0}">	
							    <a class="prev browse left"></a>
							    <div class="scrollable" id="scrollable">
							      	<div class="items">
								        <div>
										<c:forEach var="i" begin="0" end="${fn:length(design)}">
											<a href="showDesign?id=${design[i].id}">
												<img src="https://s3-ap-northeast-1.amazonaws.com/proactive/${design[i].imagePath}">
											</a>
											${(i+1)%3==0?'</div><div>':''}
										</c:forEach>
								        </div>
							      	</div>

							    </div>

							    <!-- "next page" action -->
							    <a class="next browse right"></a>
							</c:if>
							</div><!-- //.grid_8 -->	
						</div>	<!-- //.container -->	
					</div><!-- fullbackground -->
				</div><!-- //.courseDetail -->
				<div class="courseResponse">
					<div class="container">
						<ul class="tag grid_12">
							<c:forEach items="${tagList}" var="tag">
							<li><a href="javascript:;"><span>${tag.tag}</span></a></li>
							</c:forEach>
							<li class="report"><a href="#" data-reveal-id="login"><span>檢舉</span></a></li>
						</ul>
						<div class="grid_8">
							<form class="clearfix">
								<textarea name="content" id="content" cols="30" rows="10" placeholder="我想留言...."></textarea>
								<a href="#" data-reveal-id="login">
									<button type="button" class="responseButton">留言</button>
								</a>
							</form>
							<ul class="response clearfix" id="commentArea">
							<c:forEach items="${commentList}" var="comment">
								<li class="clearfix">
									<a href="aboutme?id=${comment.member.memberNO}" class="responseImg">
										<img src="https://s3-ap-northeast-1.amazonaws.com/proactive/${comment.member.photoPath}" alt="${comment.member.name}">
									</a>
									<div class="responseBox">
										<a href="javascript:;" class="responseUsr">${comment.member.name}</a>
										<p class="reponseCont">${comment.content}</p>
										<p class="reponseBottom">
											<span>${comment.createDateString}</span>
											<span class="reply" style="display: inline;">
												<a href="#" data-reveal-id="login">回覆</a>
												<a href="#" data-reveal-id="login"><span>檢舉</span></a>
											</span>
										</p>
									</div>
									<c:forEach items="${comment.replyCommentList}" var="replyComment">
									<div class="responseBox2">
										<a href="aboutme?id=${replyComment.member.memberNO}" class="responseBox2Img">
											<img src="https://s3-ap-northeast-1.amazonaws.com/proactive/${replyComment.member.photoPath}" alt="${replyComment.member.name}">
										</a>
										<div class="responseBox2_1">
											<a href="javascript:;" class="responseUsr">${replyComment.member.name}</a>
											<p class="reponseCont">${replyComment.content}</p>
											<p class="reponseBottom clearfix">
												<span>${replyComment.createDateString}</span>
												<span class="reply" style="display: inline;">
													<a href="#" data-reveal-id="login"><span>檢舉</span></a>
												</span>
											</p>
										</div>
									</div>
									</c:forEach>
								</li>
							</c:forEach>
								
							</ul>
							<div class="pageresponse clearfix">
								<c:if test="${page.show}">
								<ul>
									<c:forEach items="${page.pagerList}" var="pager">
										<li class="${pager.indexClass}"><a href="${pager.url}">${pager.index}</a></li>
									</c:forEach>			
					            </ul>
					            </c:if>
					        </div><!-- page -->
						</div>

						<div class="grid_4">
							<c:forEach items="${courseList}" var="topCourse" varStatus="i">
							<div class="grid_2 ${topCourse.classString}">
								<a href="showCourse?id=${topCourse.id}" target="_blank" class="refCourse">
									<img src="https://s3-ap-northeast-1.amazonaws.com/proactive/${topCourse.imagePath}">
								</a>
							</div>
							</c:forEach>
							<c:if test="${fn:length(courseList) > 0}">
							<div class="grid_2 modify2">
								<a href="${course.moreUrl}" target="_blank" class="arrow">${course.moreString}</a>
							</div>
							</c:if>
							<div class="grid_4 modify">
								<a href="#" class="refCourse addPractice" data-reveal-id="login"><span>我也要上傳課程</span></a>
							</div>
						</div>
					</div>
				</div>
			</div><!-- //.courseShow -->
		</div><!-- content -->
		<!-- 左側meum滑出 -->
		<nav id="menu">
			<ul>		 
				<li class="logo"><a href="index">美編網</a></li>
				<c:forEach items="${menuList}" var="menu">				
				<li class="${menu.classString2}">
					<a class="${menu.classString1}" href="${menu.url}">${menu.icon}${menu.name}</a>
				</li>
				</c:forEach>	 		
				<li class="menumember"><a href="register">註冊</a></li>
				<li class="menumember"><a href="login">登入</a></li>
			</ul>
		</nav>
	</div><!-- page -->

	<div><a href="#" id="gotop">回頂端</a></div>
	<div id="login" class="reveal-modal">
		<div class="cont clearfix">
			<div class="textaligncenter">
				<h1>會員登入</h1>
				<p class="textGray">使用facebook帳號快速登入</p>
				<button class="btn_fb-login" type="button" onclick="window.location.href='fbLogin'"> Facebook 登入</button>
				<p class="pmaillogin"><span>或</span></p>
			</div>
			<form style="text-align: center;" id="loginForm" method="post" action="checkLogin">
				<label><input type="text" class="textbox account" name="account" placeholder="請輸入帳號"></label><br>
				<label><input type="password" class="textbox key" name="password" placeholder="請輸入密碼"></label><br>
				<button class="btn_login">登入</button><br>				
				<button type="button" class="poplink" onclick="window.location.href='forgetPassword'">忘記密碼</button>
				<button type="button" class="poplink" onclick="window.location.href='register'">成為會員</button><br>
			</form>
		</div>
	</div>
	
	<!-- import jquery -->
	<script
		src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>


	<!-- some jquery method we use -->
	<script src="js/hoverjquery.js"></script>
	<script src="js/listscreen.js"></script>
	<script src="js/ourjquery.js"></script>
	<!--scrollable-->
	<script src="js/jquery.tools.min.js"></script>
	<script type="text/javascript" src="//static.addtoany.com/menu/page.js"></script>
	<!-- rwdmenu -->
	<script type="text/javascript" src="js/jquery.mmenu.min.all.js"></script>
	
	
	<!-- validate -->
    <script src="js/jquery.validate.js"></script>
    <script src="js/messages_zh_TW.js"></script>
    <script src="js/additional-methods.js"></script>
	<!-- Reveal Modal -->
	<script type="text/javascript" src="js/jquery.reveal.js"></script>	
    <!-- highlightjs -->
    <script src="ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js"></script>
	<script>
	
	$(function() {
		hljs.initHighlightingOnLoad();
		$('nav#menu').mmenu();
      	$(".scrollable").scrollable({circular: true}).autoscroll({ autoplay: true });
		
		$("#loginForm").validate({
			rules:{
				account:"required",
				password:"required"
			}
		});
    });
	</script>	
</body>
</html>